package SPAN::Method::NonLinearEquation::NewtonRaphson;

use warnings;
use strict;
use Math::Calculus::Bisection;
use Reaction::Class;

use Math::Calculus::NewtonRaphson;
use Reaction::Types::Core;
use SPAN::Types::Math::Calculus;

class NewtonRaphson is 'SPAN::Method', which {

    implements backend      => as {'Math::Calculus::NewtonRaphson'};
    implements display_name => as {'Newton-Raphson'};

    has expression => (
        isa    => 'Expression',
        is     => 'rw',
        set_or_lazy_fail('expression')
    );
    has variable =>
        ( isa => 'Variable', is => 'rw', set_or_lazy_fail('variable') );
    has start => ( isa => 'Real', is => 'rw', set_or_lazy_fail('start') );
    has precision =>
        ( isa => 'PositiveInt', is => 'rw', set_or_lazy_fail('precision') );

};

1;
